<html>
<head><meta charset="utf-8"><title>polonius-correctness-bug · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html">polonius-correctness-bug</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="127309601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309601">(May 30 2018 at 14:14)</a>:</h4>
<p>Privately, <span class="user-mention" data-user-id="116113">@lqd</span> wrote:</p>
<blockquote>
<p>for the example I've been looking at, I feel like the difference between Naive and Opt is something tiny. The 2 missing borrows we'd expect to see are from the borrow_region input tuples (making them requires tuples) but are not in the region_live_atinput -- thus making the last rule borrow_live_at(B, P) :- requires(R, B, P), region_live_at(R, P) ignore them</p>
</blockquote>
<p>and I'm moving it to a public thread. =)</p>



<a name="127309619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309619">(May 30 2018 at 14:14)</a>:</h4>
<p>specifically, the <code>Location::All</code> hack winds up adding <code>outlives</code> relationships at each point, even when some of the regions involved are not live</p>



<a name="127309632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309632">(May 30 2018 at 14:15)</a>:</h4>
<p>I changed this in my PR — removing <code>Locations::All</code> and instead equating the "inner and outer" return types at the RETURN point</p>



<a name="127309641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309641">(May 30 2018 at 14:15)</a>:</h4>
<p>sorry if that's vague :( it's hard to describe concisely, I have a comment somewhere tho</p>



<a name="127309647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309647">(May 30 2018 at 14:15)</a>:</h4>
<p>it sounds like it might repair the discrepancy, but it's an interesting meta-point: the Opt variant seems to assume a certain "WF" condition here</p>



<a name="127309713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309713">(May 30 2018 at 14:16)</a>:</h4>
<p>I rebased my branch and I'm doing a local build</p>



<a name="127309733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309733">(May 30 2018 at 14:17)</a>:</h4>
<blockquote>
<p>and I'm moving it to a public thread. =)</p>
</blockquote>
<p>much appreciated from us lurkers</p>



<a name="127309743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309743">(May 30 2018 at 14:17)</a>:</h4>
<p>(as it happens <span class="user-mention" data-user-id="116155">@Jake Goulding</span>, this is also related to that behavior we were discussing earlier)</p>



<a name="127309748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309748">(May 30 2018 at 14:17)</a>:</h4>
<p>e.g., this branch kind of doubles down on it :)</p>



<a name="127309751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309751">(May 30 2018 at 14:17)</a>:</h4>
<p>(in polonius)</p>



<a name="127309760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309760">(May 30 2018 at 14:18)</a>:</h4>
<p>but you definitely convinced me I want to revisit this question and consider some alternate, less permissive variations</p>



<a name="127309805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127309805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127309805">(May 30 2018 at 14:18)</a>:</h4>
<p>but I guess it's good to first get things working the "pure" way</p>



<a name="127310499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127310499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127310499">(May 30 2018 at 14:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> which was the failing test again?</p>



<a name="127310528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127310528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127310528">(May 30 2018 at 14:33)</a>:</h4>
<p><a href="http://issue-31567.rs" target="_blank" title="http://issue-31567.rs">issue-31567.rs</a></p>



<a name="127310532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127310532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127310532">(May 30 2018 at 14:33)</a>:</h4>
<p>hmm, ok. My branch doesn't fix it :)</p>



<a name="127310534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127310534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127310534">(May 30 2018 at 14:33)</a>:</h4>
<div class="codehilite"><pre><span></span>struct VecWrapper&lt;&#39;a&gt;(&amp;&#39;a mut S);

struct S(Box&lt;u32&gt;);

fn get_dangling&lt;&#39;a&gt;(v: VecWrapper&lt;&#39;a&gt;) -&gt; &amp;&#39;a u32 {
    let s_inner: &amp;&#39;a S = &amp;*v.0; //~ ERROR `*v.0` does not live long enough
    &amp;s_inner.0
}

impl&lt;&#39;a&gt; Drop for VecWrapper&lt;&#39;a&gt; {
    fn drop(&amp;mut self) {
        *self.0 = S(Box::new(0));
    }
}

fn main() {
    let mut s = S(Box::new(11));
    let vw = VecWrapper(&amp;mut s);
    let dangling = get_dangling(vw);
    println!(&quot;{}&quot;, dangling);
}
</pre></div>



<a name="127310580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127310580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127310580">(May 30 2018 at 14:34)</a>:</h4>
<p>I don't have time to dig further just now though</p>



<a name="127311106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127311106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127311106">(May 30 2018 at 14:45)</a>:</h4>
<p>yeah it seems the Opt variant has slightly different requirements wrt <code>borrow_region</code> and <code>region_live_at</code>, but for this particular example were not linked to <code>outlives</code>and the Location::All hack</p>



<a name="127311342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127311342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127311342">(May 30 2018 at 14:50)</a>:</h4>
<p>interesting. I don't know (yet) why else those would be violated.</p>



<a name="127311799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127311799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127311799">(May 30 2018 at 15:01)</a>:</h4>
<p>I'll try to look into which rules here make Naive produce that the regions are live at those points, and Opt is not</p>



<a name="127318316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127318316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127318316">(May 30 2018 at 17:18)</a>:</h4>
<p>btw I added the use case where Naive and Opt differ <a href="https://github.com/rust-lang-nursery/polonius/pull/67" target="_blank" title="https://github.com/rust-lang-nursery/polonius/pull/67">https://github.com/rust-lang-nursery/polonius/pull/67</a> (time for birthday dinner :)</p>



<a name="127318410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127318410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127318410">(May 30 2018 at 17:20)</a>:</h4>
<p>:)</p>



<a name="127318425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127318425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127318425">(May 30 2018 at 17:20)</a>:</h4>
<p>(looking at CI this reminds me we can remove the histo crate dependency I think)</p>



<a name="127424118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127424118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127424118">(Jun 01 2018 at 16:20)</a>:</h4>
<p>I feel one of the coolest advantages of this representation as facts, is how extremely easy it is to reduce mechanically, à la property-based testing. I think I have reduced one of the differences between Naive and Opt in issue 31567 to just 5 facts :)</p>



<a name="127425821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127425821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127425821">(Jun 01 2018 at 16:59)</a>:</h4>
<blockquote>
<p>à la property-based testing</p>
</blockquote>
<p>I reiterate my statement from before that quickcheck or proptest would be good things to cram in and let them run for a weekend</p>



<a name="127428113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127428113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127428113">(Jun 01 2018 at 17:43)</a>:</h4>
<p>yeah :)</p>



<a name="127428612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127428612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127428612">(Jun 01 2018 at 17:51)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> would you want a PR with a <code>#[should_panic]</code> test for this Naive/Opt difference ?</p>



<a name="127428699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127428699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127428699">(Jun 01 2018 at 17:52)</a>:</h4>
<p>sounds useful :)</p>



<a name="127430074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430074">(Jun 01 2018 at 18:21)</a>:</h4>
<p>it's a bit harder to do with the frontend right now until we've implemented def/use/liveness, since all these facts are at the same point, but it's similar in spirit to:</p>
<div class="codehilite"><pre><span></span>universal_regions {}
block B0 {
    borrow_region_at(&#39;a, L0), outlives(&#39;a: &#39;b), outlives(&#39;b: &#39;c), outlives(&#39;c: &#39;d), use(&#39;d); // the use here is mostly so that &#39;d is live for the frontend
}
</pre></div>



<a name="127430606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430606">(Jun 01 2018 at 18:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok so if need be all the issue-31567 facts are in PR #67, and this new reduced test is <a href="https://github.com/rust-lang-nursery/polonius/pull/69" target="_blank" title="https://github.com/rust-lang-nursery/polonius/pull/69">here</a> :)</p>



<a name="127430689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430689">(Jun 01 2018 at 18:32)</a>:</h4>
<p>awesome: I don't know when I'll have time to look, but I will say that being able to do this sort of reduction was one of the primary reasons I wanted to separate borrowck out</p>



<a name="127430692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430692">(Jun 01 2018 at 18:32)</a>:</h4>
<p>so: very cool!</p>



<a name="127430705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430705">(Jun 01 2018 at 18:33)</a>:</h4>
<p>all my engineer dreams are coming true ;)</p>



<a name="127430708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430708">(Jun 01 2018 at 18:33)</a>:</h4>
<p>:)</p>



<a name="127430709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430709">(Jun 01 2018 at 18:33)</a>:</h4>
<p>except the one where this sucker is fast (/me ducks)</p>



<a name="127430716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430716">(Jun 01 2018 at 18:33)</a>:</h4>
<p>(though from my current analysis, I think there's still lots of room to make this NLL type-check go faster...)</p>



<a name="127430717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430717">(Jun 01 2018 at 18:33)</a>:</h4>
<p>at least having the test could open the possibility for other contributors to look at it</p>



<a name="127430757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430757">(Jun 01 2018 at 18:34)</a>:</h4>
<p>yep</p>



<a name="127430766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430766">(Jun 01 2018 at 18:34)</a>:</h4>
<p>it's not clear to me that it's a <em>bug</em> exactly, this discrepancy</p>



<a name="127430767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430767">(Jun 01 2018 at 18:34)</a>:</h4>
<p>or at least it might be a prblem on rustc side</p>



<a name="127430771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430771">(Jun 01 2018 at 18:34)</a>:</h4>
<p>I'd really like to remove <code>Location::All</code></p>



<a name="127430776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430776">(Jun 01 2018 at 18:34)</a>:</h4>
<p>though I guess that doesn't fix this bug, as we said</p>



<a name="127430779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430779">(Jun 01 2018 at 18:34)</a>:</h4>
<p>I wonder if the same discrepancy is still present</p>



<a name="127430799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430799">(Jun 01 2018 at 18:35)</a>:</h4>
<p>yeah, but since it's also with the outlives, it's also confusing whether Location::All should / why it doesn't have impact here</p>



<a name="127430802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430802">(Jun 01 2018 at 18:35)</a>:</h4>
<blockquote>
<p>it's a bit harder to do with the frontend right now until we've implemented def/use/liveness, since all these facts are at the same point, but it's similar in spirit to:</p>
</blockquote>
<p>interesting; this actually does strike me as a kind of bug...</p>



<a name="127430808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430808">(Jun 01 2018 at 18:35)</a>:</h4>
<p>I'll try to look more closely</p>



<a name="127430851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430851">(Jun 01 2018 at 18:36)</a>:</h4>
<p>frontend bug ? or rustc + facts bug ?</p>



<a name="127430859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430859">(Jun 01 2018 at 18:36)</a>:</h4>
<p>er, sorry, a bug in <code>DatafrogOpt</code></p>



<a name="127430863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430863">(Jun 01 2018 at 18:36)</a>:</h4>
<p>right</p>



<a name="127430871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430871">(Jun 01 2018 at 18:36)</a>:</h4>
<p>there are no cfg edges whatsoever</p>



<a name="127430882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127430882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127430882">(Jun 01 2018 at 18:37)</a>:</h4>
<p>and we're trying to limit the TC to regions that are live-to-dead along edges _huge shortcuts in this sentence cough_</p>



<a name="127437268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127437268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127437268">(Jun 01 2018 at 20:52)</a>:</h4>
<p>The other missing loan from the same issue has basically the same structure, except the last of the 3 <code>outlives</code> is at a different point (but the <code>cfg_edge</code>s are not significant for this specific missing loan either). I'll try and look at the other -Zpolonius issues next</p>



<a name="127570321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127570321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127570321">(Jun 04 2018 at 22:38)</a>:</h4>
<p>omg I finally got through all the -Zpolonius failures Santiago posted before. I focused on finding the ones failing because of the Naive vs Opt differences, and found 11 of the 50+ failing tests. I reduced those to a smaller number (&lt;5) of vaguely distinct patterns, but it feels like it's only a couple of unique patterns — but since a few seemed very related to the TC at a single point, it's  possible it's actually a single bug. (since it hasn't been merged yet I'll repurpose PR #69 to add this small number of patterns, instead of just the one issue)</p>



<a name="127594778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127594778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127594778">(Jun 05 2018 at 11:26)</a>:</h4>
<p>ok I think it really is one single bug: there are 4 unique-ish patterns, with 3 of those being a longer chain of <code>outlives</code> at the same point, and the 4th still having the same scheme but over 2 points instead of one</p>



<a name="127594906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127594906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127594906">(Jun 05 2018 at 11:30)</a>:</h4>
<p>reduced, it looks a bit like this, whenever a region is live at a single point, Opt misses the region(s) it outlives (recursively)</p>
<div class="codehilite"><pre><span></span>universal_regions {}
block B0 {
    borrow_region_at(&#39;a, L0), outlives(&#39;a: &#39;b), use(&#39;b); // region_live_at(&#39;b)
}
</pre></div>



<a name="127594991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127594991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127594991">(Jun 05 2018 at 11:32)</a>:</h4>
<p>and in rustc's tests, there are multiple variations of this, either differing on the length of the <code>outlives</code> chain, or whether it happens at the same point or the next</p>



<a name="127595296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127595296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127595296">(Jun 05 2018 at 11:40)</a>:</h4>
<p>so I'll encode all this as 4 tests, but they are likely to be fixed at the same time</p>



<a name="127597049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597049">(Jun 05 2018 at 12:27)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've updated <a href="https://github.com/rust-lang-nursery/polonius/pull/69" target="_blank" title="https://github.com/rust-lang-nursery/polonius/pull/69">https://github.com/rust-lang-nursery/polonius/pull/69</a> could you validate my comments in the tests are clear enough for you ?</p>



<a name="127597105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597105">(Jun 05 2018 at 12:28)</a>:</h4>
<p>yep</p>



<a name="127597108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597108">(Jun 05 2018 at 12:28)</a>:</h4>
<p>thanks for doing this btw</p>



<a name="127597121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597121">(Jun 05 2018 at 12:28)</a>:</h4>
<p>comment is excellent</p>



<a name="127597132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597132">(Jun 05 2018 at 12:29)</a>:</h4>
<p>I was wondering — why can't we use the 'parser front-end for this'? in particular, does it not support kind of "Explicit form of every fact"?</p>



<a name="127597135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597135">(Jun 05 2018 at 12:29)</a>:</h4>
<p>maybe we should make that a goal :)</p>



<a name="127597138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597138">(Jun 05 2018 at 12:29)</a>:</h4>
<p>agreed</p>



<a name="127597147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597147">(Jun 05 2018 at 12:29)</a>:</h4>
<p>while the 4th test could work I think</p>



<a name="127597153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597153">(Jun 05 2018 at 12:29)</a>:</h4>
<p>the other 3 are at the same point, and so not exactly realistic wrt to the format</p>



<a name="127597202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597202">(Jun 05 2018 at 12:30)</a>:</h4>
<p>it could work with "blabla /"</p>



<a name="127597212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597212">(Jun 05 2018 at 12:30)</a>:</h4>
<p>why does being at the same point make it unrealistic?</p>



<a name="127597230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597230">(Jun 05 2018 at 12:31)</a>:</h4>
<p>just towards the format, eg I felt we mostly wanted to use the mid point</p>



<a name="127597304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597304">(Jun 05 2018 at 12:32)</a>:</h4>
<p>and here we'd have to use the start point</p>



<a name="127597383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597383">(Jun 05 2018 at 12:34)</a>:</h4>
<p>but yes I agree the frontend is made exactly for these cases :) I also initially was about to ask if you wanted to try to use it before merging those tests, instead of the facts as-is</p>



<a name="127597400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597400">(Jun 05 2018 at 12:35)</a>:</h4>
<p>question: can you readily dump out the values of the various sets for the <code>send_is_not_static_std_sync</code> test?</p>



<a name="127597404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597404">(Jun 05 2018 at 12:35)</a>:</h4>
<p>I'd be curious to see</p>



<a name="127597408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597408">(Jun 05 2018 at 12:35)</a>:</h4>
<p>sure, I'll push them</p>



<a name="127597478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597478">(Jun 05 2018 at 12:37)</a>:</h4>
<p>(I also have an ugly function doing the reduction work)</p>



<a name="127597665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597665">(Jun 05 2018 at 12:40)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <a href="https://github.com/lqd/borrow-check/commit/914889f98afb44d3bf18c479a2939b15bda4a7ea" target="_blank" title="https://github.com/lqd/borrow-check/commit/914889f98afb44d3bf18c479a2939b15bda4a7ea">https://github.com/lqd/borrow-check/commit/914889f98afb44d3bf18c479a2939b15bda4a7ea</a></p>



<a name="127597689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127597689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127597689">(Jun 05 2018 at 12:40)</a>:</h4>
<p>mutex and rwlock are the failing functions and are reduced in the tests</p>



<a name="127599518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127599518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127599518">(Jun 05 2018 at 13:17)</a>:</h4>
<blockquote>
<p>I was wondering — why can't we use the 'parser front-end for this'? in particular, does it not support kind of "Explicit form of every fact"?</p>
</blockquote>
<p>yes, this, we can't emit <code>region_live_at</code> manually right now (we kinda talked about it only as byproducts of <code>use</code> and liveness IIRC) but I can add it, we would want to avoid writing <code>region_live_at</code> as they are tedious, but for these exact cases it would have been useful :)</p>



<a name="127601964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127601964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127601964">(Jun 05 2018 at 14:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> for these tests, would you rather have the "exactly minimal facts" which were automatically reduced, or something that can be a slight superset but using the frontend ? (since the frontend is focused on statements rather than points, there could be two points and an edge being generated, when sometimes no edges are actually needed to trigger the bug)</p>



<a name="127623227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/127623227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#127623227">(Jun 05 2018 at 21:17)</a>:</h4>
<p>alright I've added <code>region_live_at</code> to the frontend, and converted the minimal reduced tests to the less-minimal frontend format :) (PR by tomorrow, although I'm not sure whether this would need bumping the polonius-parser or polonius version)</p>



<a name="134773607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134773607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134773607">(Sep 27 2018 at 21:02)</a>:</h4>
<p>revising this topic, maybe this had the bug?</p>



<a name="134773695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134773695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134773695">(Sep 27 2018 at 21:04)</a>:</h4>
<p>dang Zulip search is good btw</p>



<a name="134773719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134773719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134773719">(Sep 27 2018 at 21:05)</a>:</h4>
<p>I have literally never failed to find the thing I was looking for thus far</p>



<a name="134773880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134773880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134773880">(Sep 27 2018 at 21:08)</a>:</h4>
<p>:D (yeah it was this topic)</p>



<a name="134774128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774128">(Sep 27 2018 at 21:13)</a>:</h4>
<p>hmm ok so the test:</p>
<div class="codehilite"><pre><span></span>        universal_regions { }
        block B0 {
            borrow_region_at(&#39;a, L0),
            outlives(&#39;a: &#39;b),
            outlives(&#39;b: &#39;c),
            outlives(&#39;c: &#39;d),
            region_live_at(&#39;d);
        }
</pre></div>



<a name="134774186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774186">(Sep 27 2018 at 21:14)</a>:</h4>
<p>so ... I think that the problem is that the optimized version assumes that there are <em>two</em> live endpoints</p>



<a name="134774188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774188">(Sep 27 2018 at 21:14)</a>:</h4>
<p>but here there is only one</p>



<a name="134774196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774196">(Sep 27 2018 at 21:14)</a>:</h4>
<p>I am tempted to say that this is an invalid <em>input</em> that we should fix</p>



<a name="134774208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774208">(Sep 27 2018 at 21:15)</a>:</h4>
<p>in particular, I think that one could say that the borrow region is always live at the point where it is introduced</p>



<a name="134774216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774216">(Sep 27 2018 at 21:15)</a>:</h4>
<p>however</p>



<a name="134774221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774221">(Sep 27 2018 at 21:15)</a>:</h4>
<p>let me look at the code a bit to refresh my memory</p>



<a name="134774231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774231">(Sep 27 2018 at 21:15)</a>:</h4>
<p>e.g. this input passes</p>
<div class="codehilite"><pre><span></span>        universal_regions { }
        block B0 {
            borrow_region_at(&#39;a, L0),
            region_live_at(&#39;a),
            outlives(&#39;a: &#39;b),
            outlives(&#39;b: &#39;c),
            outlives(&#39;c: &#39;d),
            region_live_at(&#39;d);
        }
</pre></div>



<a name="134774698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774698">(Sep 27 2018 at 21:24)</a>:</h4>
<p>this would be nice, and we could quickly prototype such a fix in the same way we add all points to universal_regions</p>



<a name="134774719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774719">(Sep 27 2018 at 21:25)</a>:</h4>
<p>otoh I remember wanting it to be the case that</p>



<a name="134774734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774734">(Sep 27 2018 at 21:25)</a>:</h4>
<p>you could talk about various regions in the "mid-point" of things</p>



<a name="134774736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774736">(Sep 27 2018 at 21:25)</a>:</h4>
<p>that are never used outside</p>



<a name="134774742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774742">(Sep 27 2018 at 21:25)</a>:</h4>
<p>and only serve to make connections</p>



<a name="134774748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774748">(Sep 27 2018 at 21:25)</a>:</h4>
<p>but this is still true, I suppose</p>



<a name="134774753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774753">(Sep 27 2018 at 21:25)</a>:</h4>
<p>in particular, when you e.g. invoke a fn</p>



<a name="134774798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774798">(Sep 27 2018 at 21:26)</a>:</h4>
<p>that instantiates some higher-ranked regions at the point of call</p>



<a name="134774802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774802">(Sep 27 2018 at 21:26)</a>:</h4>
<p>and those don't appear in any MIR types, they only exist at the "mid point"</p>



<a name="134774805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774805">(Sep 27 2018 at 21:26)</a>:</h4>
<p>but they make connections between the arguments and the return type of the fn</p>



<a name="134774808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774808">(Sep 27 2018 at 21:26)</a>:</h4>
<p>e.g., <code>for&lt;'a&gt; fn(&amp;'a str) -&gt; &amp;'a str</code></p>



<a name="134774812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774812">(Sep 27 2018 at 21:26)</a>:</h4>
<p>the region that represents <code>'a</code> for any particular call</p>



<a name="134774823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134774823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134774823">(Sep 27 2018 at 21:26)</a>:</h4>
<p>so this still preserves the "both end-points are live on entry to the mid point" property</p>



<a name="134775013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775013">(Sep 27 2018 at 21:30)</a>:</h4>
<p>I am trying to bring the "opt code" back into cache now to decide how hard it would be to match behavior though :)</p>



<a name="134775024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775024">(Sep 27 2018 at 21:31)</a>:</h4>
<p>but I'm not sure if it's worth it, feels to me like the borrow region should be live at the (mid-point) of borrow</p>



<a name="134775027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775027">(Sep 27 2018 at 21:31)</a>:</h4>
<p>which I <em>think</em> is the bug here</p>



<a name="134775036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775036">(Sep 27 2018 at 21:31)</a>:</h4>
<p>very interesting cases tho, even if they don't appear quite often in the test suite</p>



<a name="134775253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775253">(Sep 27 2018 at 21:36)</a>:</h4>
<p>that's what I'm wondering</p>



<a name="134775254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775254">(Sep 27 2018 at 21:36)</a>:</h4>
<p>why only this test case?</p>



<a name="134775257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775257">(Sep 27 2018 at 21:36)</a>:</h4>
<p>I have to look at the rust test too</p>



<a name="134775274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775274">(Sep 27 2018 at 21:37)</a>:</h4>
<p>it's more let's say 10 rustc tests</p>



<a name="134775281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775281">(Sep 27 2018 at 21:37)</a>:</h4>
<p>but one pattern, only the length of the outlives chain changing (maybe 2 patterns, at most, but if memory serves, it only looked like there was one)</p>



<a name="134775362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775362">(Sep 27 2018 at 21:39)</a>:</h4>
<p>(IIRC I've mentioned in the polonius tests, the rustc tests where we saw these lengths of chains)</p>



<a name="134775427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134775427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134775427">(Sep 27 2018 at 21:40)</a>:</h4>
<p>hmm</p>



<a name="134818848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134818848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134818848">(Sep 28 2018 at 12:00)</a>:</h4>
<p>I might be Doin It Wrong™ but I tried the quick hack we mentioned yesterday, to declare that each borrow region is always live at the point where it is introduced: it seems to fix the failing tests focusing on the opt/naive difference, but will also make other tests fail (eg our key loop feature of issue-47680)</p>



<a name="134830861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134830861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134830861">(Sep 28 2018 at 15:05)</a>:</h4>
<p>interesting</p>



<a name="134830920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134830920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134830920">(Sep 28 2018 at 15:06)</a>:</h4>
<p>I don't have it quite "in cache enough" just yet</p>



<a name="134831112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug/near/134831112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/polonius-correctness-bug.html#134831112">(Sep 28 2018 at 15:09)</a>:</h4>
<p>there's no rush</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>